package com.kaifamiao.N0719;

public class Node3 {

    public static void main(String[] args) {

        int[] nums = {1, 5, 2, 5, 7, 9, 3, 6, 7, 8};
        //冒泡排序
        for (int n = 0; n < nums.length - 1; n++) {
            for (int x = 0; x < nums.length - 1 - n; x++) {
                if (nums[x] > nums[x + 1]) {
                    int y = nums[x];
                    nums[x] = nums[x + 1];
                    nums[x + 1] = y;
                }
            }
        }
        for (int x = 0; x < nums.length; x++) {
            System.out.println(nums[x]);
        }
    }
}
